<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table>
        <tr>
            <td>标题</td>
            <td><input type="text" name="biaoti"></td>
        </tr>
        <tr>
            <td>摘要</td>
            <td><input type="text" name="zhaiyao"></td>
        </tr>
        <tr>
            <td>内容</td>
            <td><input type="text" name="neirong"></td>
        </tr>
        <tr>
            <td>标题</td>
            <td><input type="text" name="fenlei"></td>
        </tr>
        <tr>
            <td>作者</td>
            <td><input type="text" name="zuozhe"></td>
        </tr>
    
        <tr>
            <td>
                <input type="button" value="保存" onclick="save_btn()">
                <input type="button" value="取消" onclick="cansel_btn()">
            </td>
 
        </tr>
    </table>



    <script src="./js/jquery-3.6.0.min.js"></script>
    <script src="./js/index.js"></script>

    <script>
         let id=window.location.search.split('?')[1];

        if(id){
            $.get(`http://localhost:8000/blog/${id}`,data=>{
             console.log(data);
             $('[name=biaoti]').val(data[0].biaoti);
             $('[name=zhaiyao]').val(data[0].zhaiyao);
             $('[name=neirong]').val(data[0].neirong);
             $('[name=fenlei]').val(data[0].fenlei);
             $('[name=zuozhe]').val(data[0].zuozhe);
         })
        }
        


    </script>
</body>
</html>